import axios from 'axios'
import { Notification, MessageBox, Message } from 'element-ui'

const request = axios.create({
  baseURL: 'http://139.224.194.55:9090/api'
})

//设置拦截器
request.interceptors.request.use(function (config) {
  // 在请求中添加Authorization字段和值
  if (sessionStorage.getItem('access_token') != null) {
    config.headers.Authorization = "Bearer " + sessionStorage.getItem('access_token')
  }
  return config
})


const request8080 = axios.create({
  baseURL: 'http://150.158.15.244:8000/'
})
export { request, request8080 } 